package com.hy.${packageCode}.shared.events;
import com.hy.${packageCode}.shared.utils.UserAuditorHelper;
import lombok.Getter;
import org.springframework.context.ApplicationEvent;

import java.time.Clock;

@Getter
public abstract class AbstractLocalEvent extends ApplicationEvent {

    private String token;

    protected AbstractLocalEvent(Object source) {
        super(source);
        this.token = UserAuditorHelper.retrieveCurrentToken().orElse(null);
    }

    protected AbstractLocalEvent(Object source, Clock clock) {
        super(source, clock);
        this.token = UserAuditorHelper.retrieveCurrentToken().orElse(null);
    }
}
